package com.example.onlineeducation.data.constant

import androidx.annotation.IntDef

/**
 * 性别
 */
object UserSexType {
    const val MAN = 1
    const val WOMEN = 2

    @IntDef(MAN, WOMEN)
    @kotlin.annotation.Retention(AnnotationRetention.SOURCE)
    annotation class Type

    @JvmStatic
    fun getName(code: Int?) = when (code) {
        WOMEN -> "女"
        MAN -> "男"
        else -> "未知"
    }
}